<template>
	<h1>Child</h1>
	<p>{{ age }}</p>
</template>

<script>
export default {
	name: "Child",
	props: {
		age: String,
	},
	emits: ["setAge"],
	setup(props, context) {
		console.log("child", props);
		console.log("context", context); // emit attrs
		context.emit("setAge"); // 触发事件

		return {
			...props,
		};
	},
};
</script>

<style></style>
